home *** CD-ROM | disk | FTP | other *** search
- Path: southwind.net!usenet
- From: uar@southwind.net (richard mross)
- Newsgroups: comp.lang.c
- Subject: Re: Settle a bet please
- Date: Mon, 01 Apr 1996 19:40:04 GMT
- Organization: SouthWind Internet Access, Inc.
- Message-ID: <4jpbgm$71v@opal.southwind.net>
- References: <4jfopb$o9n@news1.sympatico.ca>
- NNTP-Posting-Host: ict100.southwind.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Gisele Swinson <gisele.swinson@sympatico.ca> wrote:
-
- >In C language, how do they calculate the length of an array.
-
- >example
-
- >To declare a string "My Name"
-
- >is it char name[7] = "My Name"
- >or
- >is it chat Name[8] = "My Name"
-
- >There is a battle in my class whether to include the NULL in the
- >array size.
-
- >I would appreciate any input you might have.
-
- >Thanks
-
- >Gisele
-
- I believe that char Name[8] would be needed although char Name[] =
- {"..."} would be better. the [7] array does not have the space for the
- zero. I dont really know but try this.
- char name[7] = {"my name"};
- int somehting = 0xaaaa;
- then printf("[%s]",name);
- and see if it sees a null terminator or if it grabs the int too, also
- check the .map file to see if the int really follows the array..
-
-
-
-
-